<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"><head>



  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LiveValidation  - Documentation</title>
  <meta name="description" content="A javascript library for all your client-side and form validation needs.">
  <meta name="keywords" content="javascript, form, forms, validation, library, web2.0, ajax">
  <!-- yahoo user interface css 
      (reset - resets all defaults to be pretty much identical cross browser)
      (fonts - standardises default fonts styles crosss browser)
      (grids - provides cross browser positional styles for creating layouts) 
      see http://developer.yahoo.com/yui/grids/ -->
  <link rel="stylesheet" type="text/css" href="reset-fonts-grids.css">
  <link rel="stylesheet" type="text/css" href="consolidated_common.css">
  
  <!--[if IE]>
    <style type="text/css">
	  
	  #main li {
        width:auto;
      }
      
	  /* fix for fieldset background spill bug in all flavours of IE */
	  fieldset {
        position: relative;
        margin: 2em 0 1em 0;
      }
      legend {
        position: absolute;
        top: -0.5em;
        left: 0.2em;
      }
	  
    </style>
  <![endif]-->
  
  <!--[if IE 6]>
    <style type="text/css">
      #doc {
		 width:58em;
	  }
		
		#main .supportBox {
			margin-left:40px;
		}
	</style>
  <![endif]-->
  <script type="text/javascript" src="../../../classes/makumbaResources/javaScript/livevalidation_1.3_standalone.js"></script>
  	
</head><body id="top">
  <div id="bg">
	  <div id="doc">
	    <div id="hd">
	      <h1><a href="http://www.livevalidation.com/" title="home">LiveValidation</a></h1>
	      <h2>Validation as you type!</h2>
	      <ul id="head_nav">
	            <li><a href="http://www.livevalidation.com/download" title="download">download</a></li>  
	            <li><a href="http://www.livevalidation.com/documentation" title="documentation">documentation</a></li>
				<li><a href="http://www.livevalidation.com/examples" title="examples">examples</a></li>    
	      </ul>
	    </div>
	    <div id="topMain"> </div>
	    <div id="main">
			<div class="container_with_padding">
		  <h2>Documentation...</h2>
		  
		  	
		  <p>This
documentation is only concerned with the code you will actually need to
know, all methods used internally are ommitted, but they are all
documented in the source code.</p>
		  
		  <h4>Contents</h4>
		  
		  <ul>
		  	<li><strong><a href="#Validate" title="Validate (class)">Validate (class)</a></strong>
				<ul>
					<li><a href="#ValidatePresence" title="Presence (static function)">Presence (static function)</a></li>
					<li><a href="#ValidateFormat" title="Format (static function)">Format (static function)</a></li>
					<li><a href="#ValidateNumericality" title="Numericality (static function)">Numericality (static function)</a></li>
					<li><a href="#ValidateLength" title="Length (static function)">Length (static function)</a></li>
					<li><a href="#ValidateInclusion" title="Inclusion (static function)">Inclusion (static function)</a></li>
					<li><a href="#ValidateExclusion" title="Exclusion (static function)">Exclusion(static function)</a></li>
					<li><a href="#ValidateAcceptance" title="Acceptance (static function)">Acceptance (static function)</a></li>
					<li><a href="#ValidateConfirmation" title="Confirmation (static function)">Confirmation (static function)</a></li>
					<li><a href="#ValidateEmail" title="Validate.Email (static function)">Email (static function)</a></li>
					<li><a href="#ValidateCustom" title="Validate.Custom (static function)">Custom (static function)</a></li>
					<li><a href="#ValidateNow" title="Validate.now (static function)">now (static function)</a></li>
				</ul>
			</li>
			<li><strong><a href="#LiveValidation" title="LiveValidation (class)">LiveValidation (class)</a></strong>
				<ul>
					<li><a href="#LiveValidationConstructor" title="constructor">constructor</a></li>
					<li><a href="#LiveValidationAdd" title="add (function)">add (function)</a></li>
					<li><a href="#LiveValidationRemove" title="remove (function)">remove (function)</a></li>
					<li><a href="#LiveValidationDisable" title="disable (function)">disable (function)</a></li>
					<li><a href="#LiveValidationEnable" title="enable (function)">enable (function)</a></li>
					<li><a href="#LiveValidationDestroy" title="destroy (function)">destroy (function)</a></li>
					<li><a href="#LiveValidationMassValidate" title="massValidate (static function)">massValidate (static function)</a></li>
				</ul>
			</li>
			<li><strong><a href="#LiveValidationForm" title="LiveValidationForm (class)">LiveValidationForm (class)</a></strong>
				<ul>
					<li><a href="#LiveValidationFormDestroy" title="destroy (function)">destroy (function)</a></li>
				</ul>
			</li>
		  </ul> 
          <br>
		  
		  <div id="documentation">
		  	
		  <div id="introValidate">
			  <h2 id="Validate">Validate (class) <a href="#top" class="gotoTop">Top</a></h2>
			  <p>The
Validate class contains a number of static methods which are used to
perform various types of validation. These are seperated out from the
LiveValidation class so they can be used in any context in your
javascript, not just while validating form fields.</p>
			  <p>When you
add a validation to a LiveValidation object, it is one of these
validation types that you refer to, so familiarise yourself with them.
If you are already familiar with Ruby on Rails validation, then they
will be easy to remember, as they use a similar naming convention, and
similar parameters (although some parameter’s names are different due
to javascript keyword conflicts).</p>
			  <p>If used separately from a
LiveValidation, and a validation fails, a custom error is thrown which
stores the failure message, so you will need to handle this yourself if
you wish to use the message. If you just want a simple true or false,
and don't need to extract the failure message, you can use the
Validate.now method to perform the validation.</p>
		  </div>	
		  
		  
		  <div class="section" id="ValidatePresence">
          	<h3>Presence (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates that a value is present (ie. not null, undefined, or an empty string)</p>
		  	<h4>Arguments:</h4>
			<p>
				<strong>value</strong> - {mixed} - value to be checked
				<br>
				<strong>paramsObj</strong> (optional) - {Object} - object containing parameters to be used for the validation
			</p>
			<h4>Parameters for paramsObj:</h4>
			<p>
				<strong>failureMessage</strong> (optional) - {String} - message to be used upon validation failure
												<em>(DEFAULT: “Can’t be empty!”)</em>
			</p>
			<h4>Returns:</h4>
			<p>true if valid or throws a Validate.Error object containing the failure message</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">Validate.Presence( 'hello world', { failureMessage: "Supply a value!" } );</code></pre>
			<br>
		  </div>
		  
		  
		  <div class="section" id="ValidateFormat">
          	<h3>Format (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates a value against a regular expression</p>
		  	<h4>Arguments:</h4>
			<p>
				<strong>value</strong> - {mixed} - value to be checked
				<br>
				<strong>paramsObj</strong> - {Object} - object containing parameters to be used for the validation
			</p>
			<h4>Parameters for paramsObj:</h4>
			<p>
				<strong>failureMessage</strong> (optional) - {String} - message to be used upon validation failure
												<em>(DEFAULT: “Not valid!”)</em>
				<br>
				<strong>pattern</strong> - {RegExp} - regular expression to validate against
												<em>(DEFAULT: /./i)</em>
				<br>
				<strong>negate</strong> - {Boolean} - if true will be valid if the value DOES NOT match the regular expression
												<em>(DEFAULT: false)</em>
			</p>
			<h4>Returns:</h4>
			<p>true if valid or throws a Validate.Error object containing the failure message</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">// check that 'validation' exists in the string, case insensitive...
Validate.Format( 'live validation', { pattern: /validation/i, failureMessage: "Failed!" } );</code></pre>
			<br>
		  </div>
		  
		  
		  
		  <div class="section" id="ValidateNumericality">
          	<h3>Numericality (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates
that the value is numeric and: is an integer, is a specific number, is
more than a minimum number, less than a maximum number, is within a
range of numbers, or a combination of these</p>
			<p><strong>NB</strong> - numbers expressed in scientific form (ie 2e3, being 2000) are handled correctly, as are negative numbers, and floats.</p>
		  	<h4>Arguments:</h4>
			<p>
				<strong>value</strong> - {mixed} - value to be checked
				<br>
				<strong>paramsObj</strong> (optional) - {Object} - object containing parameters to be used for the validation
			</p>
			<h4>Parameters for paramsObj:</h4>
			<p>
				<strong>notANumberMessage</strong> (optional) - {String} - message to be used when validation fails because value is not a number <em>(DEFAULT: “Must be a number!”)</em>
				<br>
				<strong>notAnIntegerMessage</strong> (optional) - {String} - message to be used when validation fails because value is not an integer <em>(DEFAULT: “Must be an integer!”)</em>	
				<br>
				<strong>wrongNumberMessage</strong> (optional) -  {String} - message to be used when validation fails when ‘is’ param is used <em>(DEFAULT: “Must be {is}!”)</em>		
				<br>
				<strong>tooLowMessage</strong> (optional) -  {String} - message to be used when validation fails when ‘minimum’} param is used <em>(DEFAULT: “Must not be less than {minimum}!”)</em>
				<br>
				<strong>tooHighMessage</strong> (optional) -  {String} - message to be used when validation fails when ‘maximum’} param is used <em>(DEFAULT: “Must not be more than {maximum}!”)</em>
				<br>
				<strong>is</strong> (optional) - {mixed} - the value must be equal to this numeric value
				<br>
				<strong>minimum</strong> (optional) - {mixed} - the minimum numeric allowed
				<br>
				<strong>maximum</strong> (optional) - {mixed} - the maximum numeric allowed
				<br>
				<strong>onlyInteger</strong> (optional) - {Boolean} - if true will only allow integers to be valid <em>(DEFAULT: false)</em>
			</p>
			<h4>Returns:</h4>
			<p>true if valid or throws a Validate.Error object containing the failure message</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">// check that value is an integer between -5 and 2000 exists in the string, case insensitive...
Validate.Numericality( 2e3, { minimum: -5, maximum: 2000 } );</code></pre>
			<br>
		  </div>
		  
		  
		  <div class="section" id="ValidateLength">
          	<h3>Length (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates
the length of a value is a particular length, is more than a minimum,
less than a maximum, or between a range of lengths</p>
			<p><strong>NB</strong> - to check if it is within a range, specify both a minimum and a maximum</p>
		  	<h4>Arguments:</h4>
			<p>
				<strong>value</strong> - {mixed} - value to be checked
				<br>
				<strong>paramsObj</strong> - {Object} - object containing parameters to be used for the validation
			</p>
			<h4>Parameters for paramsObj:</h4>
			<p>
				<strong>wrongLengthMessage</strong> (optional) - {String} - message to be used when validation fails when ‘is’ param is used <em>(DEFAULT: “Must be {is} characters long!”)</em>
					
				<br>	
				<strong>tooShortMessage</strong> (optional) -  {String} - message to be used when validation fails when ‘minimum’} param is used <em>(DEFAULT: “Must not be less than {minimum} characters long!”)</em>
				<br>
				<strong>tooLongMessage</strong> (optional) -  {String} - message to be used when validation fails when ‘maximum’} param is used <em>(DEFAULT: “Must not be more than {maximum} characters long!”)</em>
				<br>
				<strong>is</strong> (optional) - {mixed} - the value must be this length
				<br>
				<strong>minimum</strong> (optional) - {mixed} - the minimum length allowed
				<br>
				<strong>maximum</strong> (optional) - {mixed} - the maximum length allowed
			</p>
			<h4>Returns:</h4>
			<p>true if valid or throws a Validate.Error object containing the failure message</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">// check that value is between 3 and 255 characters long...
Validate.Length( 'cow', { minimum: 3, maximum: 255 } );</code></pre>
			<br>
		  </div>
		  
		  
		  <div class="section" id="ValidateInclusion">
          	<h3>Inclusion (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates that a value falls within a given set of values</p>
		  	<h4>Arguments:</h4>
			<p>
				<strong>value</strong> - {mixed} - value to be checked
				<br>
				<strong>paramsObj</strong> - {Object} - object containing parameters to be used for the validation
			</p>
			<h4>Parameters for paramsObj:</h4>
			<p>
				<strong>failureMessage</strong> (optional) - {String} - message to be used upon validation failure <em>(DEFAULT: “Must be included in the list!”)</em>
				<br>	
				
				<strong>within</strong> - {Array} - an array of values that the value should fall in  <em>(DEFAULT: Empty array)</em>
				<br>
				<strong>allowNull</strong> (optional) - {Boolean} - if true, and a null value is passed in, validates as true <em>(DEFAULT: false)</em>
				<br>
				<strong>partialMatch</strong>
(optional) - {Boolean}- if true, will not only validate against the
whole value to check, but also if it is a substring of the value <em>(DEFAULT: false)</em>
				<br>
				<strong>caseSensitive</strong> (optional) - {Boolean} - if false will compare strings case insensitively<em>(DEFAULT: true)</em>
			</p>
			<h4>Returns:</h4>
			<p>true if valid or throws a Validate.Error object containing the failure message</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">Validate.Inclusion( 'cat', { within: [ 'cow', 277, 'catdog' ], allowNull: true, partialMatch: true, caseSensitive: false } );</code></pre>
			<br>
		  </div>
		  
		  
		  <div class="section" id="ValidateExclusion">
          	<h3>Exclusion (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates that a value does not fall within a given set of values</p>
		  	<h4>Arguments:</h4>
			<p>
				<strong>value</strong> - {mixed} - value to be checked
				<br>
				<strong>paramsObj</strong> - {Object} - object containing parameters to be used for the validation
			</p>
			<h4>Parameters for paramsObj:</h4>
			<p>
				<strong>failureMessage</strong> (optional) - {String} - message to be used upon validation failure <em>(DEFAULT: “Must not be included in the list!”)</em>
				<br>	
				
				<strong>within</strong> - {Array} - an array of values that the given value should not fall in <em>(DEFAULT: Empty array)</em>
				<br>
				<strong>allowNull</strong> (optional) - {Boolean} - if true, and a null value is passed in, validates as true <em>(DEFAULT: false)</em>
				<br>
				<strong>partialMatch</strong>
(optional) - {Boolean} - if true, will not only validate against the
whole value to check, but also if it is a substring of the value <em>(DEFAULT: false)</em>
				<br>
				<strong>caseSensitive</strong> (optional) - {Boolean} - if false will compare strings case insensitively<em>(DEFAULT: true)</em>
			</p>
			<h4>Returns:</h4>
			<p>true if valid or throws a Validate.Error object containing the failure message</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">Validate.Exclusion( 'pig', { within: [ 'cow', 277, 'catdog' ], allowNull: true, partialMatch: true, caseSensitive: false } );</code></pre>
			<br>
		  </div>
		  
		  
		  <div class="section" id="ValidateAcceptance">
          	<h3>Acceptance (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates that a value equates to true (for use primarily in detemining if a checkbox has been checked)</p>
		  	<h4>Arguments:</h4>
			<p>
				<strong>value</strong> - {mixed} - value to be checked
				<br>
				<strong>paramsObj</strong> (optional) - {Object} - object containing parameters to be used for the validation
			</p>
			<h4>Parameters for paramsObj:</h4>
			<p>
				<strong>failureMessage</strong> (optional) -  {String} - message to be used upon validation failure
												<em>(DEFAULT: “Must be accepted!”)</em>
			</p>
			<h4>Returns:</h4>
			<p>true if valid or throws a Validate.Error object containing the failure message</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">Validate.Acceptance( true, { failureMessage: "You must be true!" } );</code></pre>
			<br>
		  </div>
		  
		  
		  <div class="section" id="ValidateConfirmation">
          	<h3>Confirmation (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates that a value matches that of a given form field</p>
		  	<h4>Arguments:</h4>
			<p>
				<strong>value</strong> - {mixed} - value to be checked
				<br>
				<strong>paramsObj</strong> - {Object} - object containing parameters to be used for the validation
			</p>
			<h4>Parameters for paramsObj:</h4>
			<p>
				<strong>failureMessage</strong> (optional) -  {String} - message to be used upon validation failure
												<em>(DEFAULT: “Does not match!”)</em>
				<br>
				<strong>match</strong> -{mixed} - a reference to, or string id of the field that this should match
			</p>
			<h4>Returns:</h4>
			<p>true if valid or throws a Validate.Error object containing the failure message</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">Validate.Confirmation( 'open sesame', { match: 'myPasswordField', failureMessage: "Your passwords dont match!" } );</code></pre>
		  	<br>
		  </div>
		  
		  
		  <div class="section" id="ValidateEmail">
          	<h3>Email (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates a value is a valid email address</p>
			<p>This
is an example of a custom validation method. This one is essentially
just a Format validation, but one that is used often enough to merit
its own method so that you don’t need to keep remembering the same
crazy regular expression and failure message. You may want to mimic
this to create your own reuseable validations, such as phonenumbers,
postcodes etc.</p>  
		  	<h4>Arguments:</h4>
			<p>
				<strong>value</strong> - {mixed} - value to be checked
				<br>
				<strong>paramsObj</strong> - {Object} - object containing parameters to be used for the validation
			</p>
			<h4>Parameters for paramsObj:</h4>
			<p>
				<strong>failureMessage</strong> (optional) - {String} - message to be used upon validation failure <em>(DEFAULT: “Must be a valid email address!”)</em>
			</p>
			<h4>Returns:</h4>
			<p>true if valid or throws a Validate.Error object containing the failure message</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">Validate.Email( 'live@validation.com', { failureMessage: "I am an overridden message!" } );</code></pre>
			<br>
		  </div>
		  
		  
		  
		  <div class="section" id="ValidateCustom">
          	<h3>Custom (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates a value against a custom function that returns true when valid or false when not valid.</p>
			<p>You
can use this to easily wrap any special validations that are not
covered by the core ones, in a way that the LiveValidation class can
use to give the feedback, without having to worry about the details.</p>
			<h4>Arguments:</h4>
			<p>
				<strong>value</strong> - {mixed} - value to be checked
				<br>
				<strong>paramsObj</strong> - {Object} - object containing parameters to be used for the validation
			</p>
			<h4>Parameters for paramsObj:</h4>
			<p>
				<strong>against</strong> - {Function} - a function that will take the value and an object of arguments and return true or false<em>(DEFAULT:  function( value, args ){ return true; } )</em>
				<br>
				<strong>args</strong> - {Object} - an object of named arguments that will be passed to the custom function so are accessible through this object <em>(DEFAULT: Empty object)</em>
				<br>
				<strong>failureMessage</strong> (optional) - {String} - message to be used upon validation failure <em>(DEFAULT: “Not valid!”)</em>
			</p>
			<h4>Returns:</h4>
			<p>true if valid or throws a Validate.Error object containing the failure message</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">// Pass a function that checks if a number is divisible by one that you pass it in args object
// In this case, 5 is passed, so sshould return true and validation will pass
Validate.Custom( 55, { against: function(value,args){ return !(value % args.divisibleBy) }, args: {divisibleBy: 5} } );</code></pre>
			<br>
		  </div>
		  
		  
		  
		  <div class="section" id="ValidateNow">
          	<h3>now (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates
a passed in value using the passed in validation function, and handles
the validation error for you so it gives a nice true or false reply</p>
			<h4>Arguments:</h4>
			<p>
				<strong>validationFunction</strong> - {Function} - reference to the validation function to be used (ie Validate.Presence )
				<br>
				<strong>value</strong> - {mixed} - value to be checked
				<br>
				<strong>validationParamsObj</strong> - {Object} - object containing parameters to be used for the validation (optional depends upon the validation function)
			</p>
			<h4>Returns:</h4>
			<p>true if valid or false if not valid</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">Validate.now( Validate.Numericality, '2007', { is: 2007 } );</code></pre>
			<br>
		  </div>
		  
          
		  <div id="introLiveValidation">
		    <h2 id="LiveValidation">LiveValidation (class)</h2>
		    <p>The
LiveValidation class sets up a text, checkbox, file, or password input,
or a textarea to allow its value to be validated in real-time based
upon the validations you assign to it.</p>
		  </div>
		  
		  <div class="section" id="LiveValidationConstructor">
          	<h3>constructor <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>The
constructor of the LiveValidation class to set up the form field as a
LiveValidation object allows you to pass in any parameters you want to
override.</p>
			<h4>Arguments:</h4>
			<p>
				<strong>element</strong> - {mixed} - either a dom element reference or the string id of the element to validate
				<br>
				<strong>optionsObj</strong> (optional) - {Object} - object containing options to override the LiveValidation defaults
			</p>
			<h4>Parameters for paramsObj:</h4>
			<p>
				<strong>validMessage</strong> (optional) - {String} - message to be used upon successful validation <em>(DEFAULT: “Thankyou!”)</em><br>
				<strong>onValid</strong> (optional) - {Function} - function to execute when field passes validation <em>(DEFAULT: function(){ this.insertMessage( this.createMessageSpan() ); this.addFieldClass(); } )</em><br>
				<strong>onInvalid</strong> (optional) - {Function} - function to execute when field fails validation <em>(DEFAULT: function(){ this.insertMessage( this.createMessageSpan() ); this.addFieldClass(); })</em><br>
				<strong>insertAfterWhatNode</strong> (optional) - {mixed} - reference or id of node to have the message inserted after <em>(DEFAULT: the field that is being validated)</em><br>
				<strong>onlyOnBlur</strong> (optional) - {Boolean} - whether you want it to validate as you type or only on blur <em>(DEFAULT: false)</em><br>
			  <strong>wait</strong> (optional) - {Integer} - the time you want it to pause from the last keystroke before it validates (milliseconds) <em>(DEFAULT: 0)</em><br>
        <strong>onlyOnSubmit</strong> (optional) - {Boolean} - if it is part of a form, whether you want it to validate it only when the form is submitted <em>(DEFAULT: false)</em>
			</p>
			<h4>Returns:</h4>
			<p>The LiveValidation object itself so that calls can be chained</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">var myField = new LiveValidation('myField', { validMessage: "I am valid!", onlyOnBlur: true });</code></pre>
			<br>
		  </div>
		  
		  
		  
		  <div class="section" id="LiveValidationAdd">
          	<h3>add (function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Validates
a passed in value using the passed in validation function, and handles
the validation error for you so it gives a nice true or false reply.</p>
			<h4>Arguments:</h4>
			<p>
				<strong>validationFunction</strong> - {Function} - reference to the validation function to be used (ie Validate.Presence )
				<br>
				<strong>validationParamsObj</strong> - {Object} - object containing parameters to be used for the validation (optional depends upon the validation function)
			</p>
			<h4>Returns:</h4>
			<p>The LiveValidation object itself so that calls can be chained</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">var myField = new LiveValidation('myField', { validMessage: "I am valid!" });
myField.add(Validate.Format, { pattern: /^hello$/i });</code></pre>
			<br>
		  </div>
		  
		  
		  
		  <div class="section" id="LiveValidationRemove">
          	<h3>remove (function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Removes a specific validation from the stack of validations that have been added</p>
			<p><strong>Note</strong> - you must pass it EXACTLY the same arguments as you used to add the validation</p>
			<p>This is useful when writing custom code that alters validations based on whatever else may be happening on your webpage</p>
			<h4>Arguments:</h4>
			<p>
				<strong>validationFunction</strong> - {Function} - reference to the validation function being used (ie Validate.Presence )
				<br>
				<strong>validationParamsObj</strong>
- {Object} - object containing parameters beeing used for the
validation (optional depends upon whether used when the validation was
added) </p>
			<h4>Returns:</h4>
			<p>The LiveValidation object itself so that calls can be chained</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">var myField = new LiveValidation('myField');
// add a Format and Length validation
myField.add(Validate.Format, { minimum: /^woohoo+$/ }).add(Validate.Length, {maximum: 20});
// now remove only the Format validation 
myField.remove(Validate.Format, { minimum: /^woohoo+$/ });</code></pre>
			<br>
		  </div>
		  
		  
		  
		  <div class="section" id="LiveValidationDisable">
          	<h3>disable (function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>A
helper to disable a field, so that validations are not run on it, and
its value will not be posted if part of a form. It will also remove any
previous validation message and field class.</p>
			<p>This is useful for forms which can have different fields filled in depending upon choices they are given.</p>
			<h4>Returns:</h4>
			<p>The LiveValidation object itself so that calls can be chained</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">var myField = new LiveValidation('myField');
// disable the field - validations will not be run on this field, and its contents not submitted
myfield.disable();</code></pre>
			<br>
		  </div>
		  
		  
		  
		  <div class="section" id="LiveValidationEnable">
          	<h3>enable (function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>A helper to enable a disabled field.</p>
			<p>Will cause validations to be performed on the field again, after having been previously disabled.</p>
			<h4>Returns:</h4>
			<p>The LiveValidation object itself so that calls can be chained</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">var myField = new LiveValidation('myField');
// disable the field - validations will not be run on this field
myfield.disable();
// enable the field again - validations will now be run again
myField.enable();</code></pre>
			<br>
		  </div>
		  
		  
		  
		  
		  <div class="section" id="LiveValidationDestroy">
          	<h3>destroy (function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Will
unregister all events of the LiveValidation object (preserving
previously defined events) and remove it from any LiveValidationForm it
might belong to.</p>
			<p>This is useful if you don’t want a field to
be a LiveValidation field any longer, or need to redefine a field as a
new LiveValidation object with different parameters.</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">var myField = new LiveValidation('myField');
myfield.destroy();</code></pre>
			<br>
		  </div>
		  
		  
		  
		  <div class="section" id="LiveValidationMassValidate">
          	<h3>massValidate (static function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Pass an array of LiveValidation objects and it will validate all of them and return whether they pass or fail as a group</p> 
			<p><strong>Note</strong> - as of release 1.2 it is unlikely you will ever need to use this function, as validation of all fields in 
a form on submission is now handled automatically.</p>
		  	<h4>Arguments:</h4>
			<p>
				<strong>validations</strong> - {Array} - an array of LiveValidation objects
			</p>
			<h4>Returns:</h4>
			<p>true if all the validations pass, false if any fail</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">// pass in an array of LiveValidation objects...
var areAllValid = LiveValidation.massValidate( [ obj1, obj2 ] );</code></pre>
			<br>
		  </div>
		  
		  
		  
		  
		  
		  <div id="introLiveValidationForm">
		    <h2 id="LiveValidationForm">LiveValidationForm (class)</h2>
		    <p>If
a LiveValidation field belongs to a form, that form will be
automatically turned into a LiveValidationForm. This will handle making
all LiveValidation fields that are part of it run validations when the
form is submitted, and stop the form being sent if any are invalid.</p>
		  </div>
		  
		  <div class="section" id="LiveValidationFormDestroy">
          	<h3>destroy (function) <a href="#top" class="gotoTop">Top</a></h3>
		  	<p>Will
unregister all events of the LiveValidationForm object (preserving
previously defined events), but only if there are no more
LiveValidation objects belonging to it (unless forced to do so)</p>
			<p>It
is probably rare that you will need to use this as it is done
automatically when LiveValidation objects are destroyed, but is useful
for tests.</p>
			<h4>Arguments:</h4>
			<p>
				<strong>force</strong> - {Boolean} - whether to force the destruction even if it has child LiveValidation objects
			</p>
			<h4>Example:</h4>
			<pre><code lang="javascript">var myField = new LiveValidation('myField');
// access the LiveValidationForm object through one of its child LiveValidation objects form property
myfield.form.destroy(true);</code></pre>
			<br>
		  </div>
		  
          </div>
          
			</div>
		</div>
	    <div id="bottomMain"> </div>
	    <div id="ft">  
	        <ul id="foot_nav">
	        	<li><a href="http://www.livevalidation.com/" title="home">home</a></li>  
	            <li><a href="http://www.livevalidation.com/examples" title="examples">examples</a></li> 
	            <li><a href="http://www.livevalidation.com/documentation" title="documentation">docs</a></li>  
	            <li><a href="http://www.livevalidation.com/download" title="download">download</a></li>
							<li><a href="http://www.livevalidation.com/blog" title="blog">blog</a></li>  
	            <li><a href="http://www.livevalidation.com/support" title="support">support</a></li>
							<li><a href="http://www.livevalidation.com/contact" title="contact">contact</a></li>
							<li><a href="http://www.livevalidation.com/license" title="license">license</a></li>   
	        </ul>
			<br>
			<p>© 2007-2008 Alec Hill | MIT license</p>
	    </div>
	  </div>
  </div>

</body>
